package ioccontainer;
import java.lang.reflect.InvocationTargetException;

import parser.ParserTypes;


public class GenericXmlApplicationContext {

	private final XMLBeanDefinitionReader reader = new XMLBeanDefinitionReader();
	private BeanFactory beanFactory;
			
	public void setParserType(ParserTypes parserType) {
		reader.setParserType(parserType);
	}
	
	public void load(String XMLFileLocation) throws ClassNotFoundException, AmbiguityException, InvocationTargetException, 
	IllegalAccessException, InstantiationException, NoSuchMethodException {		
		reader.loadBeanDefinitions(XMLFileLocation);
		beanFactory = new BeanFactoryImpl(reader.getBeanDefinitions());
	}
	
	public BeanFactory getBeanFactory() {
		return beanFactory;
	}
	
}